extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
	int tolua_tarray_open(lua_State* tolua_S);
}

#include "tarray.h"
#include <iostream>
using namespace std;

int g_Arr[10] = { 0 };

int main()
{
	lua_State *L = luaL_newstate();
	int i = 0;
	for (i = 0; i < 10; i++)
		g_Arr[i] = i;
	luaopen_base(L);

	tolua_tarray_open(L);
	luaL_dofile(L, "F:\\test_tolua\\ConsoleApplication1\\ConsoleApplication1\\array.lua");

	for (i = 0; i < 10; i++)
		cout << g_Arr[i]<<" ";

	cout << endl;
	lua_close(L);

	return 0;
}